home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Development Kits / MPW etc. / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / GoggleSprocketDevices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-23  |  3.3 KB  |  116 lines  |  [TEXT/CWIE]

  1. /*
  2. ********************************************************************************
  3. **
  4. ** Name: GoggleSprocketDevices.h
  5. **
  6. ** Description:
  7. **
  8. **    Header file for the device-level interface for stereoscopic devices.
  9. **
  10. ********************************************************************************
  11. */
  12. #ifndef GOGGLESPROCKETDEVICES
  13. #define GOGGLESPROCKETDEVICES
  14.  
  15. #include <Displays.h>
  16. #include <Types.h>
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. /*
  23. ********************************************************************************
  24. ** constants & data types
  25. ********************************************************************************
  26. */
  27. /* GoggleSprocket file creator type */
  28. #define kGoggleSprocketCreatorType 'GSp '
  29.  
  30. /* device error codes */
  31. enum {
  32.     kGSpDeviceError_NoMoreModes            = 1,
  33.     kGSpDeviceError_UnsupportedCall        = 2
  34. };
  35. typedef UInt32 gDSpDeviceError;
  36.  
  37. /* device type */
  38. enum {
  39.     kGSpDeviceKind_Unknown            = 0,
  40.     kGSpDeviceKind_FrameSequential    = 1,    /* i.e. shutter glasses */
  41.     kGSpDeviceKind_Stereoscopic        = 2        /* i.e. hmd */
  42. };
  43. typedef UInt32 GSpDeviceKind;
  44.  
  45. /* mode data format */
  46. enum {
  47.     kGSpModeDataFormat_Unknown        = 0,
  48.     kGSpModeDataFormat_Normal        = 1,
  49.     kGSpModeDataFormat_Interleaved    = 2
  50. };
  51. typedef UInt32 GSpModeDataFormat;
  52.  
  53. /* mode attributes */
  54. enum {
  55.     kGSpModeAttribute_CustomProcess                = (1L << 0L),
  56.     kGSpModeAttribute_FullDisplayRequired        = (1L << 1L),
  57.     kGSpModeAttribute_ManualEyeToggleRequired    = (1L << 2L),
  58.     kGSpModeAttribute_RightEyeDataFirst            = (1L << 3L),
  59.     kGSpModeAttribute_PrimeBuffers                = (1L << 4L)
  60. };
  61. typedef UInt32 GSpModeAttributes;
  62.  
  63. /* mode information */
  64. struct GSpDeviceModeInfo {
  65.     GSpModeDataFormat        format;
  66.     GSpModeAttributes        attributes;
  67.     
  68.     /* non-zero if attached to specific display */
  69.     DisplayIDType            displayID;
  70.     
  71.     /* display requirement ranges are [low,high] inclusive bounds, 0 = don't care */
  72.     UInt32                    displayWidthRange[2];
  73.     UInt32                    displayHeightRange[2];
  74.     UInt32                    displayDepthRange[2];
  75.     
  76.     /* frequencies are Fixed point values */
  77.     Fixed                    displayFrequencyRange[2];
  78. };
  79. typedef struct GSpDeviceModeInfo GSpDeviceModeInfo;
  80.  
  81. /*
  82. ********************************************************************************
  83. ** calls exported by the stereoscopic device driver
  84. ********************************************************************************
  85. */
  86. /* general */
  87. OSStatus GSpDevice_Open( void );
  88. OSStatus GSpDevice_Close( void );
  89.  
  90. /* device configuration */
  91. OSStatus GSpDevice_Configure( Point *inUpperLeft );
  92.  
  93. /* mode iteration */
  94. OSStatus GSpDevice_GetFirstModeInfo( GSpDeviceModeInfo *outFirstModeInfo );
  95. OSStatus GSpDevice_GetNextModeInfo( GSpDeviceModeInfo *inCurrentModeInfo,
  96.             GSpDeviceModeInfo *outNextModeInfo );
  97.  
  98. /* for manual eye toggle */
  99. OSStatus GSpDevice_SetVisibleEye( Boolean inLeftEyeVisible );
  100. OSStatus GSpDevice_GetVisibleEye( Boolean *outLeftEyeVisible );
  101.  
  102. /* custom buffer processing by device */
  103. OSStatus GSpDevice_CustomBufferProcess(
  104.             CGrafPtr inLeftEyeBuffer,        /* left eye image                */
  105.             CGrafPtr inRightEyeBuffer,        /* right eye image                */
  106.             CGrafPtr inDestBuffer,            /* dest buffer                    */
  107.             Boolean inBuildLeftEyeBuffer,    /* 0 = build right eye image    */
  108.             CTabHandle ioColorTable,        /* src color table to use        */
  109.             Boolean *outShowDisplayBuffer,    /* 0 = driver will show output    */
  110.             Boolean *outCTabChanged );        /* 0 = driver didnt change ctab    */
  111.  
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115.  
  116. #endif /* GOGGLESPROCKETDEVICES */